<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
<script>
    function check(name){
        //使用jquery调用controller
        $.get("checkName/"+name,function(str){
            $("#h").html(str)
        });  //get返回字符串 getJSON 返回json
    }
    //页面加载事件
    $(function(){
        $.getJSON("/queryQxs",function(json){
            //获得下拉框一
            var qxid=$("#qxid");
            //循环json集合  <c:foreacht  items=json var =this
            $.each(json,function(i){
                qxid.append(new Option(this.qx,this.qxid));
            })
        }) ;
    });
</script>
</head>
<body>
        <h1 id="h"></h1>
<input type="text" onblur="check(this.value)">


        <select name="qxid" id="qxid"></select>

        <select name="jdid" id="jdid"></select>


</body>
</html>





